.\" Copyright (C) 2014 Shang-Rong Cai. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $ DIDF: did_meta.3    Rev. 0.1.1    2014-04-18T00:48+08:00 $
.TH DID_META 3 2014-04-18 "DIDF 0.1" "Duplex Index Data File Manual"
.SH NAME
\fBdid_meta_t\fP, \fBdid_meta_set_info\fP, \fBdid_meta_stdout\fP - meta part of
duplex index data file
.SH SYNOPSIS
\fB#include <did.h>\fP

\fIdid_meta_t mtprt;\fP

\fIint\fP
.br
\fBdid_meta_set_info\fP(\fIdid_meta_t\fP \fI*mtprt\fP,
\fIconst\fP \fIdid_head_t\fP \fI*hdprt\fP,
.br
    \fIconst\fP \fIuint64_t\fP \fIfiz\fP,
\fIconst\fP \fIuint64_t\fP \fIsiz\fP,
\fIconst\fP \fIuint64_t\fP \fIdez\fP);

\fIint\fP
.br
\fBdid_meta_stdout\fP(\fIconst\fP \fIdid_meta_t\fP \fI*mtprt\fP);

.SH DESCRIPTION
The fuction \fBdid_meta_set_info\fP() is using to create a proper meta for file
with respect the to the amounts of structures of data entries to storing.  On
the other hand, the function \fBdid_meta_stdout\fP() is to show the amounts of
structures to the standard output (screen).  The parameters of basic functions
for \fBdid_meta_t\fP data structure:
.TP
\fBmtprt\fP
The data structure objects.
.TP
\fBhdprt\fP
The corresponding head part by \fBdid_head_t\fP.
.TP
\fBfiz\fP
The least upper bound of the first index; the smallest value is always begin
from 0.
.TP
\fBsiz\fP
The least upper bound of the second index; the smallest value is always begin
from 0.
.TP
\fBdez\fP
The amount of total duplex index data.

.LP
The return value is the error number.

The data structure \fBdid_meta_t\fP is define as the following.

.nf
typedef struct
{
    uint64_t fst_idx_sz;  /* First index bound */
    uint64_t snd_idx_sz;  /* Second index bound */
    uint64_t dat_ent_sz;  /* Number of data entry */

    uint64_t fst_idx_dst_addr;  /* Address for first index depended distribution */
    uint64_t idx_dat_lst_addr;  /* Address for indexed data entry list */

    uint64_t snd_idx_dst_addr;  /* Address for second index depended distribution */
    uint64_t idx_shf_lst_addr;  /* Address for index and offset list */
} did_meta_t;

.fi

The \fBfst_idx_dst_addr\fP is the start address in bytes of file, and also the
same meanings for the \fBidx_dat_lst_addr\fP, \fBsnd_idx_dst_addr\fP, and
\fBidx_shf_lst_addr\fP.  The values of them will be created automatically by
calling the function \fBdid_meta_set_info\fP(), and users should be not to set
them by themselves.

.SH SEE ALSO
did_head_t(3), did_read_meta(3)
